Skip to content

Set upper and lower interpolation bounds for MGXS data.#3803

Merged
GuySten merged 5 commits into
openmc-dev:developfrom
nuclearkevin:set_data_bnds_mg
Feb 15, 2026
Merged

Set upper and lower interpolation bounds for MGXS data.#3803
GuySten merged 5 commits into
openmc-dev:developfrom
nuclearkevin:set_data_bnds_mg

Conversation

@nuclearkevin

@nuclearkevin nuclearkevin commented Feb 12, 2026

Copy link
Copy Markdown
Member

Description

When running OpenMC with the C/C++ API in multi-group mode, an error will get thrown when cell temperatures are set with openmc_cell_set_temperature(...):

Temperature of 600 K is below minimum temperature at which data is available of 1.7976931348623157e+308 K.

The error is caused by data::temperature_min and data::temperature_max not being set when loading multi-group cross sections. This PR adds a code block to compute the minimum and maximum values, which fixes a longstanding bug in Cardinal.

Combining this fix with some changes in Cardinal (clearing and reloading MGXS after temperatures are set) part of the fix for #2402

FYI @meltawila, @aprilnovak

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Comment thread src/mgxs.cpp Outdated
Comment thread src/mgxs.cpp

@GuySten GuySten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@GuySten GuySten added Merging Soon PR will be merged in < 24 hrs if no further comments are made. and removed Merging Soon PR will be merged in < 24 hrs if no further comments are made. labels Feb 15, 2026
Comment thread src/mgxs.cpp Outdated
@GuySten GuySten added the Merging Soon PR will be merged in < 24 hrs if no further comments are made. label Feb 15, 2026
@GuySten
GuySten merged commit c6ef84d into openmc-dev:develop Feb 15, 2026
16 checks passed
@nuclearkevin
nuclearkevin deleted the set_data_bnds_mg branch February 19, 2026 18:27
jon-proximafusion pushed a commit to shimwell/openmc that referenced this pull request Apr 13, 2026
apingegno pushed a commit to apingegno/openmc that referenced this pull request May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merging Soon PR will be merged in < 24 hrs if no further comments are made. MGXS Multi-Group Mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants